package com.ilxqx.framework.security.config;

import org.springframework.context.annotation.Bean;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.HeaderHttpSessionIdResolver;
import org.springframework.session.web.http.HttpSessionIdResolver;

/**
 * @author venus
 */
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 3600)
public class HttpSessionConfig {

    /**
     * 设置session获取的方式
     * @return sessionId获取对象
     */
    @Bean
    public HttpSessionIdResolver httpSessionIdListener () {
        return new HeaderHttpSessionIdResolver("X-Auth-Token");
    }

}
